[ykj_id].vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431
  1. <script setup>
  2. import * as echarts from 'echarts'
  3. import request from "~/utils/request";
  4. import {REQUEST} from "~/utils/request";
  5. import {user} from "~/store";
  6. import {useRouter} from "vue-router";
  7. const router = useRouter();
  8. const route = useRoute();
  9. const linkTo = (obj) => {
  10. router.push(obj);
  11. };
  12. let ykj_id = $ref('');
  13. let ykj_name = $ref('');
  14. let sm_id = $ref('');
  15. let subject_id = $ref('')
  16. let school_list = $ref([])
  17. let subject_list = $ref([])
  18. let tableData = $ref([])
  19. let barSubject = $ref([]);
  20. let barPercent = $ref([]);
  21. let barUnusual = $ref(['缺考','学号异常','页码异常','缺考异常','客观题异常','选择题异常','判断题异常','填空题异常']);
  22. let barUnData = $ref([40,70,100,70,70,70,80,90])
  23. let sub_nav = [{
  24. id:'1',
  25. name:'教师批阅情况'
  26. },{
  27. id:'2',
  28. name:'科目批阅进度总览'
  29. }]
  30. let cur_sub = $ref({
  31. id:'1',
  32. name:'教师批阅情况'
  33. })
  34. function getFilterData() {
  35. let data = {
  36. ykj_id: ykj_id
  37. };
  38. request({
  39. url: "/yzy/ksjh/detail",
  40. data: data,
  41. }).then((res) => {
  42. if (res.code === '1') {
  43. subject_list = res.data.one_info.ykj_kskm_ex;
  44. school_list = res.data.one_info.ykj_lkxx_ex;
  45. }
  46. })
  47. }
  48. function getData() {
  49. let data = {
  50. ykj_id: ykj_id,
  51. sm_id: sm_id,
  52. subject_id: subject_id,
  53. };
  54. request({
  55. url: "/yzy/scan/km",
  56. data: data,
  57. }).then((res) => {
  58. if (res.code === '1') {
  59. ykj_name = res.data.ksjh.ykj_ksrwmc;
  60. tableData = res.data.list;
  61. barSubject = [];
  62. barPercent = [];
  63. tableData.forEach(item =>{
  64. barSubject.push(item.ze_xueke_name);
  65. barPercent.push(item.scan_percent);
  66. })
  67. nextTick(()=>{
  68. initChart();
  69. })
  70. }
  71. })
  72. }
  73. function initChart() {
  74. // 基于准备好的dom,初始化echarts实例
  75. let myChart = echarts.init(document.getElementById('barBox'));
  76. myChart.setOption({
  77. tooltip: {
  78. trigger: 'axis',
  79. axisPointer: {
  80. type: 'shadow'
  81. }
  82. },
  83. grid: {
  84. left: '3%',
  85. right: '4%',
  86. bottom: '3%',
  87. containLabel: true
  88. },
  89. xAxis: [
  90. {
  91. type: 'category',
  92. name: '教师',
  93. data: barSubject,
  94. axisTick: {
  95. alignWithLabel: true
  96. },
  97. }
  98. ],
  99. yAxis: [
  100. {
  101. type: 'value',
  102. name: '扫描进度(%)',
  103. nameTextStyle: {
  104. fontSize: 14
  105. }
  106. }
  107. ],
  108. series: [
  109. {
  110. type: 'bar',
  111. barWidth: '27px',
  112. label: {
  113. show: true,
  114. position: 'top',
  115. color: '#000',
  116. fontSize: 14
  117. },
  118. itemStyle:{
  119. color:'#6897FF',
  120. borderRadius: [16, 16, 0, 0]
  121. },
  122. data: barPercent
  123. }
  124. ]
  125. });
  126. }
  127. function initUnChart() {
  128. // 绘制图表
  129. let myChart_u = echarts.init(document.getElementById('unBox'));
  130. myChart_u.setOption({
  131. tooltip: {
  132. trigger: 'axis',
  133. axisPointer: {
  134. type: 'shadow'
  135. }
  136. },
  137. grid: {
  138. left: '3%',
  139. right: '4%',
  140. bottom: '3%',
  141. containLabel: true
  142. },
  143. xAxis: [
  144. {
  145. type: 'category',
  146. name: '学科',
  147. data: barSubject,
  148. axisTick: {
  149. alignWithLabel: true
  150. },
  151. }
  152. ],
  153. yAxis: [
  154. {
  155. type: 'value',
  156. name: '批阅进度(%)',
  157. nameTextStyle: {
  158. fontSize: 14
  159. }
  160. }
  161. ],
  162. series: [
  163. {
  164. type: 'bar',
  165. barWidth: '27px',
  166. label: {
  167. show: true,
  168. position: 'top',
  169. color: '#000',
  170. fontSize: 14
  171. },
  172. itemStyle:{
  173. color:'#6897FF',
  174. borderRadius: [16, 16, 0, 0]
  175. },
  176. data: barUnData
  177. }
  178. ]
  179. });
  180. }
  181. function switchSub(item) {
  182. cur_sub = item;
  183. if(item.id === '1') {
  184. nextTick(()=>{
  185. initChart();
  186. })
  187. } else {
  188. nextTick(()=>{
  189. initUnChart();
  190. })
  191. }
  192. }
  193. onMounted(() => {
  194. if (route.params.ykj_id) {
  195. ykj_id = route.params.ykj_id;
  196. getData();
  197. getFilterData();
  198. }
  199. })
  200. </script>
  201. <route lang="json">
  202. {
  203. "meta":{
  204. "title":"扫描批阅进度",
  205. "breadcrumb":true
  206. }
  207. }
  208. </route>
  209. <template>
  210. <NavHeader/>
  211. <bread-crumb/>
  212. <div class="w-1200px m-auto">
  213. <div class="relative -mt-40px flex justify-end">
  214. <button type="button" class="back-btn" @click="linkTo({name:'process'})">返回</button>
  215. </div>
  216. <div class="mt-10px w-full bg-hex-fff py-20px px-15px">
  217. <h3 class="mb-20px text-16px text-center">{{ykj_name}}</h3>
  218. <ul class="tab-nav m-auto">
  219. <li @click="linkTo({name:'process-smpyjd-ykj_id',params:{ykj_id:ykj_id}})">科目扫描进度</li>
  220. <li @click="linkTo({name:'process-kdsmjd-ykj_id',params:{ykj_id:ykj_id}})">考点扫描进度</li>
  221. <li class="selected">批阅进度</li>
  222. </ul>
  223. <div class="mt-30px flex items-center justify-between">
  224. <div>
  225. <el-select v-model="subject_id" placeholder="全部科目" size="large" @change="getData">
  226. <el-option label="全部" value=""
  227. />
  228. <el-option
  229. v-for="item in subject_list"
  230. :key="item.subject_id"
  231. :label="item.subject_name"
  232. :value="item.subject_id"
  233. />
  234. </el-select>
  235. <el-select class="ml-20px" v-model="sm_id" placeholder="全部学校" size="large" @change="getData">
  236. <el-option label="全部" value=""
  237. />
  238. <el-option
  239. v-for="item in school_list"
  240. :key="item.sm_id"
  241. :label="item.sm_name"
  242. :value="item.sm_id"
  243. />
  244. </el-select>
  245. </div>
  246. <ul class="sub-nav">
  247. <li v-for="item in sub_nav" :class="item.id === cur_sub.id?'selected':''" @click="switchSub(item)">{{item.name}}</li>
  248. </ul>
  249. </div>
  250. <div v-if="cur_sub.id === '1'">
  251. <div id="barBox" style="height: 500px"></div>
  252. <table class="mt-20px data-table" cellpadding="0" cellspacing="0">
  253. <tr>
  254. <th>教师</th>
  255. <th>进度</th>
  256. <th>完成量</th>
  257. <th>总份数</th>
  258. <th>平均分</th>
  259. <th>操作</th>
  260. </tr>
  261. <tr v-for="item in tableData">
  262. <td>{{item.ze_xueke_name}}</td>
  263. <td>{{item.scan_percent}}</td>
  264. <td>{{item.student_num}}</td>
  265. <td>{{item.scan_num}}</td>
  266. <td>{{item.qks}}</td>
  267. <td>
  268. <button type="button" class="op-btn">查看详情</button>
  269. </td>
  270. </tr>
  271. </table>
  272. </div>
  273. <div v-else>
  274. <div id="unBox" style="height: 500px"></div>
  275. <table class="mt-20px data-table" cellpadding="0" cellspacing="0">
  276. <tr>
  277. <th>学科</th>
  278. <th>批阅进度</th>
  279. <th>总份数</th>
  280. <th>完成量</th>
  281. <th>标记<br>异常数</th>
  282. <th>平均分</th>
  283. <th>满分</th>
  284. <th>在线人数</th>
  285. <th>操作</th>
  286. </tr>
  287. <tr v-for="item in tableData">
  288. <td>{{item.ze_xueke_name}}</td>
  289. <td>{{item.scan_percent}}</td>
  290. <td>{{item.student_num}}</td>
  291. <td>{{item.scan_num}}</td>
  292. <td>{{item.qks}}</td>
  293. <td>{{item.xhycs}}</td>
  294. <td>{{item.ymycs}}</td>
  295. <td>{{item.qkycs}}</td>
  296. <td>
  297. <button type="button" class="op-btn">查看详情</button>
  298. </td>
  299. </tr>
  300. </table>
  301. </div>
  302. </div>
  303. </div>
  304. </template>
  305. <style scoped lang="scss">
  306. $color: #0048e5;
  307. .tab-nav{
  308. width: 457px;
  309. background: #ffffff;
  310. border: 1px solid #dbe7ec;
  311. border-radius: 6px;
  312. display: flex;
  313. align-items: center;
  314. padding: 6px 9px;
  315. li{
  316. width: 140px;
  317. height: 28px;
  318. border-radius: 4px;
  319. font-size: 16px;
  320. color: #666;
  321. text-align: center;
  322. line-height: 28px;
  323. cursor: pointer;
  324. &+li{
  325. margin-left: 10px;
  326. }
  327. &.selected{
  328. background: #e2eaf9;
  329. color: #000;
  330. }
  331. }
  332. }
  333. .data-table {
  334. width: 100%;
  335. table-layout: fixed;
  336. tr:nth-child(even) {
  337. background: #F1F7FF;
  338. }
  339. th {
  340. height: 74px;
  341. background: $color;
  342. font-weight: normal;
  343. text-align: center;
  344. font-size: 16px;
  345. color: #fff;
  346. &:first-child{
  347. border-radius: 6px 0 0 0;
  348. }
  349. &:last-child{
  350. border-radius: 0 6px 0 0;
  351. }
  352. }
  353. td {
  354. padding: 15px 0;
  355. font-size: 16px;
  356. color: #474747;
  357. text-align: center;
  358. }
  359. }
  360. .no-data {
  361. width: 100%;
  362. height: 450px;
  363. display: flex;
  364. justify-content: center;
  365. align-items: center;
  366. .no-data-img {
  367. width: 233px;
  368. height: 199px;
  369. background: url("/images/no-data.png") center no-repeat;
  370. }
  371. }
  372. .op-btn {
  373. width: 82px;
  374. height: 30px;
  375. background: #fff;
  376. border: 1px solid #003eee;
  377. border-radius: 2px;
  378. font-size: 14px;
  379. color: #003eee;
  380. text-align: center;
  381. &:disabled{
  382. background: #ccc;
  383. border-color: #ccc;
  384. color: #fff;
  385. pointer-events: none;
  386. }
  387. }
  388. .sub-nav{
  389. width: 280px;
  390. height: 30px;
  391. display: flex;
  392. li{
  393. width: 50%;
  394. background: #ffffff;
  395. font-size: 16px;
  396. color: #000;
  397. border: 1px solid #dbe7ec;
  398. line-height: 28px;
  399. text-align: center;
  400. cursor: pointer;
  401. &.selected{
  402. border-radius: 4px!important;
  403. background:#003eee;
  404. border-color: #003eee;
  405. color: #fff;
  406. }
  407. &:first-child{
  408. border-right: 0;
  409. border-radius: 4px 0 0 4px;
  410. }
  411. &:last-child{
  412. border-left: 0;
  413. border-radius: 0 4px 4px 0;
  414. }
  415. }
  416. }
  417. </style>